-
Notifications
You must be signed in to change notification settings - Fork 4
Make resource compatible with Bitbucket 7 #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
#git checkout -B $branch origin/$branch | ||
|
||
git fetch $depthflag origin "${prq_from_branch}" | ||
git checkout -B "${prq_from_branch}" "origin/${prq_from_branch}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This changes the behavior of the resource.
The original code would checkout the special commit refs/pull-requests/$id/merge which is an automatic merge of the branches involved in the pull request.
To maintain the same behavior, we should checkout the to_branch and immediately merge the from_branch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have to say I am not a git pro. In my understanding you want to do the following:
Pseudo:
git fetch […] from_branch
git fetch […] to_branch
git checktout -B to_branch
git merge from_branch
?? commit // What to do on merge conflict?
Can you please confirm my assumption or state the git calls to be integrated?
Hi, thanks for your PR, I think this change is globally a good idea. We didn't made the move to bitbucket 7 within emerald-squad, so I will have to check that these change still work with older versions before we can merge them. |
The fixes supplied by the PR are working, but we stumbled upon another issue in the prq_hash=$(echo "$ls_remote" | grep -E "/pull\-requests/${prq_number}/from" | awk '{print $1}') that is also relying on the old ref. We have been able to workaround this by using the eager PR plugin for the moment, but this should also be fixed. I am tough on schedule this week and holidays coming afterwards, so it looks like I won´t be able to supply that fix. Could you help out here? |
Fixed the merge conflict. Using the resource with the modifications without problems.
|
Add target branch to git config meta data
@holgerstolzenberg @thomasd- is this issue fixed ? |
@thomasd- any updates on this PR |
The PR in general restores the compatibility with Bitbucket 7+ using the REST API instead of the Git refs. It is in an early but working stage and might need further cleanup/refactoring.
Code review and advice is pretty much appreciated.
The PR also adds a config option (
debug
) to the resource to turn on bash tracing.Fixes #3